
import {simpleServer} from '@/tools/servers'

/**
 * 购物车
 */
export class ShoppingCartService {
    // 分页查询列表
    static findShoppingCarts (pageDTO) {
        var httpMethod = 'POST';
        var body = simpleServer.getArgs(this.findShoppingCarts,arguments,'POST');
        return simpleServer.connection(httpMethod, '/simple/shoppingCart/ShoppingCart/findShoppingCarts', body);
    }


    //根据购物车Id查询购物车
    static findShoppingCart (shoppingCartId) {
        var httpMethod = 'GET';
        var body = simpleServer.getArgs(this.findShoppingCart ,arguments,'GET');
        return simpleServer.connection(httpMethod, '/simple/shoppingCart/ShoppingCart/findShoppingCart',body);
    }

    //为了编辑,根据购物车Id查询购物车
    static findShoppingCartForEdit(shoppingCartId) {
        var httpMethod = 'GET';
        var body = simpleServer.getArgs(this.findShoppingCartForEdit ,arguments,'GET');
        return simpleServer.connection(httpMethod, '/simple/shoppingCart/ShoppingCart/findShoppingCartForEdit',body);
    }

    //为了查看,根据购物车Id查询购物车，所有外键字段的名称都已加载
    static findShoppingCartForView(shoppingCartId) {
        var httpMethod = 'GET';
        var body = simpleServer.getArgs(this.findShoppingCartForView ,arguments,'GET');
        return simpleServer.connection(httpMethod, '/simple/shoppingCart/ShoppingCart/findShoppingCartForView',body);
    }

    //创建新的购物车
    static createShoppingCart() {
        var httpMethod = 'GET';
        var body = simpleServer.getArgs(this.createShoppingCart,arguments,'GET');
        return simpleServer.connection(httpMethod, '/simple/shoppingCart/ShoppingCart/createShoppingCart',body);
    }

    //保存购物车
    static saveShoppingCart(shoppingCart) {
        var httpMethod = 'POST';
        var body = simpleServer.getArgs(this.saveShoppingCart,arguments,'POST');
        return simpleServer.connection(httpMethod, '/simple/shoppingCart/ShoppingCart/saveShoppingCart', body);
    }

    //编辑购物车
    static updateShoppingCart (shoppingCart) {
        var httpMethod = 'POST';
        var body = simpleServer.getArgs(this.updateShoppingCart,arguments,'POST');
        return simpleServer.connection(httpMethod, '/simple/shoppingCart/ShoppingCart/updateShoppingCart', body);
    }

    //根据购物车Id删除购物车
    static deleteShoppingCart (shoppingCartId) {
        var httpMethod = 'GET';
        var body = simpleServer.getArgs(this.deleteShoppingCart,arguments,'GET');
        return simpleServer.connection(httpMethod, '/simple/shoppingCart/ShoppingCart/deleteShoppingCart',body);
    }

    //为了查看,根据购物车Id查询购物车，只加载ID 和 名称
    static findShoppingCartsWithIdNameById(shoppingCartId) {
        var httpMethod = 'GET';
        var body = simpleServer.getArgs(this.findShoppingCartsWithIdNameById ,arguments,'GET');
        return simpleServer.connection(httpMethod, '/simple/shoppingCart/ShoppingCart/findShoppingCartsWithIdNameById',body);
    }

    //为了查看,根据购物车 名称 查询购物车，只加载ID 和 名称
    static findShoppingCartsWithIdNameByName(shoppingCartName) {
        var httpMethod = 'GET';
        var body = simpleServer.getArgs(this.findShoppingCartsWithIdNameByName ,arguments,'GET');
        return simpleServer.connection(httpMethod, '/simple/shoppingCart/ShoppingCart/findShoppingCartsWithIdNameByName',body);
    }


}
